<?php

/******************************************
* File:				lib_forms.php
* Version:			1.0.1
* Last modified:	25/10/2009
* Last modifier:	Hugo Lavigne
*****************************************/

Function form_connection_ldap()
{
	Print("
		<center>
			<table>
				<tr>
					<td>
						<div id=\"box\">
							<table>
								<tr>
									<td>
										<h3>
											<div class=\"user\">
												Identification
												<br><small style=\"font-size: 12px;\">Connexion</small>
											</div>
										</h3>
									</td>
								</tr>
								<tr>
									<td>
										<form action=\"login.php\" method=POST>
										<input type=hidden name=\"action\" value=\"login\">
									<table cellpadding=0 cellspacing=0 border=0>
										<tr>
											<td>Utilisateur :</td>
											<td><input class=\"itxt\" type=text name=\"user\" size=20></td>
											<td><img src=\"$_SESSION[path_images]/login/user_1.png\" width=16 height=16></td>
											<td></td>
										</tr>
										<tr>
											<td>Mot de passe :</td>
											<td><input class=\"itxt\" type=password name=\"pass\" size=20></td>
											<td><img src=\"$_SESSION[path_images]/login/secu_1.png\" width=16 height=16></td>
										</tr>
										<tr>
											<td>Se connecter en tant qu'administrateur :</td>
											<td><input type=checkbox name=\"chkadm\" value=\"TRUE\"></td>
											<td><img src=\"$_SESSION[path_images]/login/admin_1.png\" width=16 height=16></td>
											<td><input type=submit value=\"Ok\" onClick=\"this.form.submit();this.disabled=true;this.value='Connexion en cours...'\"></td>
										</tr>
									</table>
										</form>
									</td>
								</tr>
							</table>
						</div>
					</td>
				</tr>
			</table>
		</center>
		
	"); 
	return;
}

Function form_connection_mysql()
{	
	Print("
		<center>
			<table>
				<tr>
					<td>
						<div id=\"box\">
							<table>
								<tr>
									<td>
										<h3>
											<div class=\"user\">
												Identification
												<br><small style=\"font-size: 12px;\">Connexion</small>
											</div>
										</h3>
									</td>
								</tr>
								<tr>
									<td>
										<form action=\"login.php\" method=POST>
										<input type=hidden name=\"action\" value=\"login\">
										<table cellpadding=0 cellspacing=3 border=0>
											<tr>
												<td width=100%>Utilisateur :</td>
												<td width=10%><input class=\"itxt\" type=text name=\"user\" size=20></td>
												<td width=5%><img src=\"$_SESSION[path_images]/login/user_1.png\" width=16 height=16></td>
											</tr>
											<tr>
												<td>Mot de passe :</td>
												<td><input class=\"itxt\" type=password name=\"pass\" size=20></td>
												<td><img src=\"$_SESSION[path_images]/login/secu_1.png\" width=16 height=16></td>
												<td><input type=submit value=\"Connexion\" onClick=\"this.form.submit();this.disabled=true;this.value='Connexion en cours...'\"></td>
											</tr>
										</table>
											</form>
										<table>
											<tr>
												<td><a href=\"login.php?action=pass\">Mot de passe perdu ?</a></td>
											</tr>
										</table>
									</td>
								</tr>
							</table>
						</div>
					</td>
				</tr>
			</table>
		</center>
	"); 
	return;
}

Function form_pass_forget()
{
	 Print("
		<center>
			<table>
				<tr>
					<td>
						<div id=\"box\">
							<table>
								<tr>
									<td>
										<h3>
											<div class=\"question\">
												Identification
												<br><small style=\"font-size: 12px;\">Oubli de mot de passe</small>
											</div>
										</h3>
									</td>
								</tr>
								<tr>
									<td>
										Entrez votre nom d'utilisateur pour recevoir un nouveau mot de passe.
										<br><br>
											<form action=\"login.php?action=pass\" method=POST>
											<input type=hidden name=\"action\" value=\"pass\">
										<table cellpadding=0 cellspacing=0 border=0 width=100%>
											<tr>
												<td width=100%>Utilisateur :</td>
												<td width=5%><input class=\"itxt\" type=text name=\"user\" size=20></td>
												<td width=2%><img src=\"$_SESSION[path_images]/login/user_1.png\" width=16 height=16></td>
												<td width=80% align=left><input type=submit value=\"R&eacute;cup&eacute;rer\" onClick=\"this.form.submit();this.disabled=true;this.value='R&eacute;cup&eacute;ration en cours...'\"></td>
											</tr>
										</table>
											</form>
									</td>
								</tr>
							</table>
						</div>
					</td>
				</tr>
			</table>
		</center>
	"); 
	return;
}

Function form_signup($action="user")
{
	if ($action == "user")
	{
		Print("
			<form action=\"signup.php\" method=POST>
			<input type=hidden name=\"action\" value=\"signup\">
		");
	}
	elseif ($action == "admin")
	{
		Print("
			<form action=\"admin.php?action=users\" method=POST>
			<input type=hidden name=\"sub\" value=\"add\">
		");
	}
	
	Print("
		<center>
			<table>
				<tr>
					<td>
						<div id=\"box\">
							<table>
								<tr>
									<td>
										<h3>
											<div class=\"signup\">
												Inscription
												<br><small style=\"font-size: 12px;\">Nouvel utilisateur</small>
											</div>
										</h3>
									</td>
								</tr>
								<tr>
									<td>
										<table cellpadding=0 cellspacing=3 border=0 width=100%>
											<tr>
												<td width=100%>Utilisateur :</td>
												<td width=15%><input class=\"itxt\" type=text name=\"user\" size=15></td>
												<td width=5%><img src=\"$_SESSION[path_images]/login/user_1.png\" width=16 height=16></td>
											</tr>
											<tr>
												<td>Mot de passe :</td>
												<td><input class=\"itxt\" type=password name=\"pass1\" size=15></td>
												<td><img src=\"$_SESSION[path_images]/login/secu_1.png\" width=16 height=16></td>
											</tr>
											<tr>
												<td>Confirmation :</td>
												<td><input class=\"itxt\" type=password name=\"pass2\" size=15></td>
												<td></td>
											</tr>
											<tr>
												<td>Adresse E-Mail :</td>
												<td><input class=\"itxt\" type=text name=\"mail\" size=15></td>
												<td><img src=\"$_SESSION[path_images]/login/mail_1.png\" width=16 height=16></td>
												<td><input type=submit value=\"Ok\" onClick=\"this.form.submit();this.disabled=true;this.value='Inscription en cours...'\"></td>
											</tr>
										</table>
									</td>
								</tr>
							</table>
						</div>
					</td>
				</tr>
			</table>
		</center>
			</form>
	");
	return;
}

?>